Skip to content

BUG: Let _get_itk_pixelid map np.int64 to itk.int64_t, instead of itk.SL - #6771

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
N-Dekker:Fix-issue-6770-get_itk_pixelid-int64
Aug 20, 2026
Merged

BUG: Let _get_itk_pixelid map np.int64 to itk.int64_t, instead of itk.SL#6771
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
N-Dekker:Fix-issue-6770-get_itk_pixelid-int64

Conversation

@N-Dekker

Copy link
Copy Markdown
Contributor

Aims to fix issue InsightSoftwareConsortium#6770,
"`_get_itk_pixelid(numpy_array)` returns 32-bit `long` for `np.int64` on Windows"
@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances area:Python wrapping Python bindings for a class labels Aug 20, 2026
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This change maps NumPy int64 arrays to ITK’s fixed-width int64_t alias rather than the platform-dependent long alias. The mapping was exercised under simulated LLP64 and LP64 ABI models: the updated code selects a 64-bit type in both cases, while the previous code selected a 32-bit long under LLP64. No defects were found.

T-Rex validation blocked

A native ITK array-conversion run could not be performed because the local environment is missing the required tools and packages: CMake, Ninja, Pixi, NumPy, and ITK. The focused type-mapping check completed without those dependencies.

Confidence Score: 5/5

The change is safe to merge: it corrects the fixed-width type selected for NumPy int64 on LLP64 platforms while retaining 64-bit selection on LP64 platforms.

The only changed mapping was executed against both affected ABI models and showed the intended corrected behavior with no regression in the LP64 case. No review findings remain.

Files Needing Attention: No files need follow-up attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the ITK int64 pixel-ID ABI probe for HEAD^ under LLP64 and LP64, then repeated for worktree under both ABI models to compare results.
  • Observed that the parent revision used a 32-bit long for LLP64 while the updated revision switched to a fixed-width 64-bit model for LLP64 and LP64, confirming the intended width change without altering LP64 behavior.
  • Tried a native ITK conversion run but could not start due to missing CMake, Ninja, Pixi, NumPy, and ITK in the local environment.
  • Ran the exact worktree commands for LLP64 and LP64; both models exited with code 0 and after-state showed compatibility across models.
  • Captured a blocker snapshot showing the dependencies and tools unavailable, explaining why the native ITK run could not proceed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "BUG: Let _get_itk_pixelid map np.int64 t..." | Re-trigger Greptile

@hjmjohnson
hjmjohnson merged commit 9f127d9 into InsightSoftwareConsortium:main Aug 20, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Python wrapping Python bindings for a class type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_get_itk_pixelid(numpy_array) returns 32-bit long for np.int64 on Windows

3 participants